/**
 *
 *sum=5050
sum=5050
sum=5050
0x55d8488d2149 0x55d8488d2149 0x55d8488d2149 
sum=5050
sum=5050
*/
#include<stdio.h>

typedef int (*FUN_P)(int);
int getSum(int n){
	int sum = 0;
	for(int i = 0 ; i <= n ; i++){
		sum += i;
	}
	return sum;
}

int main(int argc, const char *argv[]){
	int (*p)(int) = getSum;
	printf("sum=%d\n",getSum(100));
	printf("sum=%d\n",p(100));
	printf("sum=%d\n",(*p)(100));
	
	printf("%p %p %p \n",getSum, p, *p);
	
	FUN_P p2 = getSum;
	printf("sum=%d\n",p2(100));
	printf("sum=%d\n",(*p2)(100));
	return 0;
}
